package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Device;
import org.apache.ibatis.annotations.Mapper;

/**
 * @Description DeviceMapper
 * @Author loe
 * @Date 2024-07-23
 */
@Mapper
public interface DeviceMapper {

    /**
     * 判断设备名称是否已存在
     * @param deviceName
     * @return
     */
    boolean checkIsSameByDeviceName(String deviceName);

    /**
     * 新增设备
     * @param device
     */
    void insert(Device device);

    /**
     * 分页查询设备列表
     * @return
     */
    Page<Device> pageQueryDevice(String deviceName, Integer locationType, String productKey);

    /**
     * 根据iotId查询设备
     * @param iotId
     * @return
     */
    Device selectByIotId(String iotId);

    void updateDevice(Device device);

    void deleteByIotId(String iotId);
}
